/*
 * @Author: C.
 * @Date: 2023-01-29 15:50:16
 */
import type { AppRouteModule } from '/@/router/types';
import { getParentLayout, LAYOUT } from '/@/router/constant';
const ExceptionPage = () => import('/@/views/sys/exception/Exception.vue');
import { ExceptionEnum } from '/@/enums/exceptionEnum';

import { t } from '/@/hooks/web/useI18n';
import { getSwaggerIp } from '../../../../jv_package/utils/system/index';

const system: AppRouteModule = {
  path: '/dev',
  name: 'Dev',
  component: LAYOUT,
  redirect: '/dev/listdemo',
  meta: {
    orderNo: 1,
    icon: 'ion:settings-outline',
    title: '开发文档',
  },
  children: [
    // 页面示例
    {
      path: '/page-demo',
      name: 'PageDemo',
      meta: {
        orderNo: 1,
        icon: 'ion:aperture-outline',
        title: '页面示例',
      },
      children: [
        // =============================form start=============================
        {
          path: 'form',
          name: 'FormPage',
          redirect: '/page-demo/form/basic',
          component: getParentLayout('FormPage'),
          meta: {
            title: t('routes.demo.page.form'),
          },
          children: [
            {
              path: 'highform',
              name: 'highform',
              component: () => import('/@/views/demo/page/form/highForm/index.vue'),
              meta: {
                title: '混合表单',
              },
            },
            {
              path: 'basic',
              name: 'FormBasicPage',
              component: () => import('/@/views/demo/page/form/basic/index.vue'),
              meta: {
                title: t('routes.demo.page.formBasic'),
              },
            },
            {
              path: 'step',
              name: 'FormStepPage',
              component: () => import('/@/views/demo/page/form/step/index.vue'),
              meta: {
                title: t('routes.demo.page.formStep'),
              },
            },
            {
              path: 'high',
              name: 'FormHightPage',
              component: () => import('/@/views/demo/page/form/high/index.vue'),
              meta: {
                title: t('routes.demo.page.formHigh'),
              },
            },
          ],
        },
        // =============================form end=============================
        // =============================desc start=============================
        {
          path: 'desc',
          name: 'DescPage',
          component: getParentLayout('DescPage'),
          redirect: '/page-demo/desc/basic',
          meta: {
            title: t('routes.demo.page.desc'),
          },
          children: [
            {
              path: 'highdesc',
              name: 'highdesc',
              component: () => import('/@/views/demo/page/desc/highDesc/index.vue'),
              meta: {
                title: '混合详情',
              },
            },
            {
              path: 'basic',
              name: 'DescBasicPage',
              component: () => import('/@/views/demo/page/desc/basic/index.vue'),
              meta: {
                title: t('routes.demo.page.descBasic'),
              },
            },
            {
              path: 'high',
              name: 'DescHighPage',
              component: () => import('/@/views/demo/page/desc/high/index.vue'),
              meta: {
                title: t('routes.demo.page.descHigh'),
              },
            },
          ],
        },
        // =============================desc end=============================

        // =============================result start=============================
        {
          path: 'result',
          name: 'ResultPage',
          redirect: '/page-demo/result/success',
          component: getParentLayout('ResultPage'),

          meta: {
            title: t('routes.demo.page.result'),
          },
          children: [
            {
              path: 'success',
              name: 'ResultSuccessPage',
              component: () => import('/@/views/demo/page/result/success/index.vue'),
              meta: {
                title: t('routes.demo.page.resultSuccess'),
              },
            },
            {
              path: 'fail',
              name: 'ResultFailPage',
              component: () => import('/@/views/demo/page/result/fail/index.vue'),
              meta: {
                title: t('routes.demo.page.resultFail'),
              },
            },
          ],
        },
        // =============================result end=============================

        // =============================account start=============================
        {
          path: 'account',
          name: 'AccountPage',
          component: getParentLayout('AccountPage'),
          redirect: '/page-demo/account/setting',
          meta: {
            title: t('routes.demo.page.account'),
          },
          children: [
            {
              path: 'center',
              name: 'AccountCenterPage',
              component: () => import('/@/views/demo/page/account/center/index.vue'),
              meta: {
                title: t('routes.demo.page.accountCenter'),
              },
            },
            {
              path: 'setting',
              name: 'AccountSettingPage',
              component: () => import('/@/views/demo/page/account/setting/index.vue'),
              meta: {
                title: t('routes.demo.page.accountSetting'),
              },
            },
          ],
        },
        // =============================account end=============================
        // =============================exception start=============================
        {
          path: 'exception',
          name: 'ExceptionPage',
          component: getParentLayout('ExceptionPage'),
          redirect: '/page-demo/exception/404',
          meta: {
            title: t('routes.demo.page.exception'),
          },
          children: [
            {
              path: '403',
              name: 'PageNotAccess',
              component: ExceptionPage,
              props: {
                status: ExceptionEnum.PAGE_NOT_ACCESS,
              },
              meta: {
                title: '403',
              },
            },
            {
              path: '404',
              name: 'PageNotFound',
              component: ExceptionPage,
              props: {
                status: ExceptionEnum.PAGE_NOT_FOUND,
              },
              meta: {
                title: '404',
              },
            },
            {
              path: '500',
              name: 'ServiceError',
              component: ExceptionPage,
              props: {
                status: ExceptionEnum.ERROR,
              },
              meta: {
                title: '500',
              },
            },
            {
              path: 'net-work-error',
              name: 'NetWorkError',
              component: ExceptionPage,
              props: {
                status: ExceptionEnum.NET_WORK_ERROR,
              },
              meta: {
                title: t('routes.demo.page.netWorkError'),
              },
            },
            {
              path: 'not-data',
              name: 'NotData',
              component: ExceptionPage,
              props: {
                status: ExceptionEnum.PAGE_NOT_DATA,
              },
              meta: {
                title: t('routes.demo.page.notData'),
              },
            },
          ],
        },
        // =============================exception end=============================
        // =============================list start=============================
        {
          path: 'list',
          name: 'ListPage',
          component: getParentLayout('ListPage'),
          redirect: '/page-demo/list/card',
          meta: {
            title: t('routes.demo.page.list'),
          },
          children: [
            {
              path: 'highTable',
              name: 'highTable',
              meta: {
                title: '混合表格',
              },
              component: () => import('/@/views/demo/page/list/highTable/index.vue'),
            },
            {
              path: 'basic',
              name: 'ListBasicPage',
              component: () => import('/@/views/demo/page/list/basic/index.vue'),
              meta: {
                title: t('routes.demo.page.listBasic'),
              },
            },
            {
              path: 'card',
              name: 'ListCardPage',
              component: () => import('/@/views/demo/page/list/card/index.vue'),
              meta: {
                title: t('routes.demo.page.listCard'),
              },
            },
            {
              path: 'search',
              name: 'ListSearchPage',
              component: () => import('/@/views/demo/page/list/search/index.vue'),
              meta: {
                title: t('routes.demo.page.listSearch'),
              },
            },
          ],
        },
        // =============================list end=============================
      ],
    },
    // 功能示例
    {
      path: '/feat',
      name: 'FeatDemo',
      meta: {
        orderNo: 2,
        icon: 'ion:git-compare-outline',
        title: '功能示例',
      },

      children: [
        {
          path: 'icon',
          name: 'IconDemo',
          component: () => import('/@/views/demo/feat/icon/index.vue'),
          meta: {
            title: t('routes.demo.feat.icon'),
          },
        },
        {
          path: 'ws',
          name: 'WebSocket',
          component: () => import('/@/views/demo/feat/ws/index.vue'),
          meta: {
            title: t('routes.demo.feat.ws'),
          },
        },
        {
          path: 'request',
          name: 'RequestDemo',
          // @ts-ignore
          component: () => import('/@/views/demo/feat/request-demo/index.vue'),
          meta: {
            title: t('routes.demo.feat.requestDemo'),
          },
        },
        {
          path: 'session-timeout',
          name: 'SessionTimeout',
          component: () => import('/@/views/demo/feat/session-timeout/index.vue'),
          meta: {
            title: t('routes.demo.feat.sessionTimeout'),
          },
        },
        {
          path: 'print',
          name: 'Print',
          component: () => import('/@/views/demo/feat/print/index.vue'),
          meta: {
            title: t('routes.demo.feat.print'),
          },
        },
        {
          path: 'tabs',
          name: 'TabsDemo',
          component: () => import('/@/views/demo/feat/tabs/index.vue'),
          meta: {
            title: t('routes.demo.feat.tabs'),
            hideChildrenInMenu: true,
          },
          children: [
            {
              path: 'detail/:id',
              name: 'TabDetail',
              component: () => import('/@/views/demo/feat/tabs/TabDetail.vue'),
              meta: {
                currentActiveMenu: '/feat/tabs',
                title: t('routes.demo.feat.tabDetail'),
                hideMenu: true,
                dynamicLevel: 3,
                realPath: '/feat/tabs/detail',
              },
            },
          ],
        },
        {
          path: 'breadcrumb',
          name: 'BreadcrumbDemo',
          redirect: '/feat/breadcrumb/flat',
          component: getParentLayout('BreadcrumbDemo'),
          meta: {
            title: t('routes.demo.feat.breadcrumb'),
          },

          children: [
            {
              path: 'flat',
              name: 'BreadcrumbFlatDemo',
              component: () => import('/@/views/demo/feat/breadcrumb/FlatList.vue'),
              meta: {
                title: t('routes.demo.feat.breadcrumbFlat'),
              },
            },
            {
              path: 'flatDetail',
              name: 'BreadcrumbFlatDetailDemo',
              component: () => import('/@/views/demo/feat/breadcrumb/FlatListDetail.vue'),
              meta: {
                title: t('routes.demo.feat.breadcrumbFlatDetail'),
                hideMenu: true,
                hideTab: true,
                currentActiveMenu: '/feat/breadcrumb/flat',
              },
            },
            {
              path: 'children',
              name: 'BreadcrumbChildrenDemo',
              component: () => import('/@/views/demo/feat/breadcrumb/ChildrenList.vue'),
              meta: {
                title: t('routes.demo.feat.breadcrumbChildren'),
              },
              children: [
                {
                  path: 'childrenDetail',
                  name: 'BreadcrumbChildrenDetailDemo',
                  component: () => import('/@/views/demo/feat/breadcrumb/ChildrenListDetail.vue'),
                  meta: {
                    currentActiveMenu: '/feat/breadcrumb/children',
                    title: t('routes.demo.feat.breadcrumbChildrenDetail'),
                    //hideTab: true,
                    // hideMenu: true,
                  },
                },
              ],
            },
          ],
        },

        {
          path: 'context-menu',
          name: 'ContextMenuDemo',
          component: () => import('/@/views/demo/feat/context-menu/index.vue'),
          meta: {
            title: t('routes.demo.feat.contextMenu'),
          },
        },
        {
          path: 'download',
          name: 'DownLoadDemo',
          component: () => import('/@/views/demo/feat/download/index.vue'),
          meta: {
            title: t('routes.demo.feat.download'),
          },
        },
        {
          path: 'click-out-side',
          name: 'ClickOutSideDemo',
          component: () => import('/@/views/demo/feat/click-out-side/index.vue'),
          meta: {
            title: t('routes.demo.feat.clickOutSide'),
          },
        },
        {
          path: 'img-preview',
          name: 'ImgPreview',
          component: () => import('/@/views/demo/feat/img-preview/index.vue'),
          meta: {
            title: t('routes.demo.feat.imgPreview'),
          },
        },
        {
          path: 'copy',
          name: 'CopyDemo',
          component: () => import('/@/views/demo/feat/copy/index.vue'),
          meta: {
            title: t('routes.demo.feat.copy'),
          },
        },
        {
          path: 'msg',
          name: 'MsgDemo',
          component: () => import('/@/views/demo/feat/msg/index.vue'),
          meta: {
            title: t('routes.demo.feat.msg'),
          },
        },
        {
          path: 'watermark',
          name: 'WatermarkDemo',
          component: () => import('/@/views/demo/feat/watermark/index.vue'),
          meta: {
            title: t('routes.demo.feat.watermark'),
          },
        },
        {
          path: 'ripple',
          name: 'RippleDemo',
          component: () => import('/@/views/demo/feat/ripple/index.vue'),
          meta: {
            title: t('routes.demo.feat.ripple'),
          },
        },
        {
          path: 'full-screen',
          name: 'FullScreenDemo',
          component: () => import('/@/views/demo/feat/full-screen/index.vue'),
          meta: {
            title: t('routes.demo.feat.fullScreen'),
          },
        },
        {
          path: '/error-log',
          name: 'ErrorLog',
          component: () => import('/@/views/sys/error-log/index.vue'),
          meta: {
            title: t('routes.demo.feat.errorLog'),
          },
        },
        {
          path: 'excel',
          name: 'Excel',
          redirect: '/feat/excel/customExport',
          component: getParentLayout('Excel'),
          meta: {
            // icon: 'mdi:microsoft-excel',
            title: t('routes.demo.excel.excel'),
          },

          children: [
            {
              path: 'customExport',
              name: 'CustomExport',
              component: () => import('/@/views/demo/excel/CustomExport.vue'),
              meta: {
                title: t('routes.demo.excel.customExport'),
              },
            },
            {
              path: 'jsonExport',
              name: 'JsonExport',
              component: () => import('/@/views/demo/excel/JsonExport.vue'),
              meta: {
                title: t('routes.demo.excel.jsonExport'),
              },
            },
            {
              path: 'arrayExport',
              name: 'ArrayExport',
              component: () => import('/@/views/demo/excel/ArrayExport.vue'),
              meta: {
                title: t('routes.demo.excel.arrayExport'),
              },
            },
            {
              path: 'importExcel',
              name: 'ImportExcel',
              component: () => import('/@/views/demo/excel/ImportExcel.vue'),
              meta: {
                title: t('routes.demo.excel.importExcel'),
              },
            },
          ],
        },
        {
          path: 'testTab/:id',
          name: 'TestTab',
          component: () => import('/@/views/demo/feat/tab-params/index.vue'),
          meta: {
            title: t('routes.demo.feat.tab'),
            carryParam: true,
            hidePathForChildren: true,
          },
          children: [
            {
              path: 'testTab/id1',
              name: 'TestTab1',
              component: () => import('/@/views/demo/feat/tab-params/index.vue'),
              meta: {
                title: t('routes.demo.feat.tab1'),
                carryParam: true,
                ignoreRoute: true,
              },
            },
            {
              path: 'testTab/id2',
              name: 'TestTab2',
              component: () => import('/@/views/demo/feat/tab-params/index.vue'),
              meta: {
                title: t('routes.demo.feat.tab2'),
                carryParam: true,
                ignoreRoute: true,
              },
            },
          ],
        },
        {
          path: 'testParam/:id',
          name: 'TestParam',
          component: getParentLayout('TestParam'),
          meta: {
            title: t('routes.demo.feat.menu'),
            ignoreKeepAlive: true,
          },
          children: [
            {
              path: 'sub1',
              name: 'TestParam_1',
              component: () => import('/@/views/demo/feat/menu-params/index.vue'),
              meta: {
                title: t('routes.demo.feat.menu1'),
                ignoreKeepAlive: true,
              },
            },
            {
              path: 'sub2',
              name: 'TestParam_2',
              component: () => import('/@/views/demo/feat/menu-params/index.vue'),
              meta: {
                title: t('routes.demo.feat.menu2'),
                ignoreKeepAlive: true,
              },
            },
          ],
        },
      ],
    },
    // 测试示例
    {
      path: '/testdemo',
      name: 'testdemo',
      meta: {
        orderNo: 3,
        icon: 'ion:git-compare-outline',
        title: '测试示例',
      },
      children: [
        {
          path: 'voucher',
          name: 'voucher',
          meta: {
            title: '凭证demo',
          },
          component: () => import('/@/views/demo/testdemo/voucher/index.vue'),
        },
      ],
    },
    // 文档集合
    {
      path: '/docdemo ',
      name: 'docdemo',
      meta: {
        orderNo: 3,
        icon: 'ion:git-compare-outline',
        title: '文档列表',
      },
      children: [
        {
          path: getSwaggerIp(),
          name: 'DocExternal',
          meta: {
            title: 'swagger接口',
          },
        },
        {
          path: 'https://www.antdv.com/components/overview-cn/',
          name: 'antdvdoc',
          meta: {
            title: 'ant-design-vue组件',
          },
        },
        {
          path: 'http://doc.vvbin.cn/',
          name: 'vbendoc',
          meta: {
            title: 'vben文档',
          },
        },
      ],
    },
    {
      path: 'langView',
      name: 'langView',
      meta: {
        title: '多语言表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/langView/index.vue'),
    },
    {
      path: 'fieldView',
      name: 'fieldView',
      meta: {
        title: '字段预设表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/fieldView/index.vue'),
    },
    {
      path: 'mapsView',
      name: 'mapsView',
      meta: {
        title: '枚举表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/mapsView/index.vue'),
    },
    {
      path: 'routeView',
      name: 'routeView',
      meta: {
        title: '路由表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/routeView/index.vue'),
    },
    {
      path: 'settingView',
      name: 'settingView',
      meta: {
        title: '项目配置表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/settingView/index.vue'),
    },
    {
      path: 'aboutView',
      name: 'aboutView',
      meta: {
        title: '项目预览表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/aboutView/index.vue'),
    },
    {
      path: 'errorView',
      name: 'errorView',
      meta: {
        title: '错误监控表',
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/dev/errorView/index.vue'),
    },
  ],
};
export default system;
